package com.wx.md.socket;

import org.java_websocket.client.WebSocketClient;
import org.java_websocket.drafts.Draft_6455;
import org.java_websocket.handshake.ServerHandshake;

import java.net.URI;

public class MyWebSocketClient  extends WebSocketClient {

    public MyWebSocketClient(URI serverUri) {
        super(serverUri);
    }

    @Override
    public void onOpen(ServerHandshake serverHandshake) {
        System.out.println("onOpen:");
    }

    @Override
    public void onMessage(String s) {
        System.out.println("onMessage:"+s);
    }

    @Override
    public void onClose(int i, String s, boolean b) {
        System.out.println("onClose:"+s);
    }

    @Override
    public void onError(Exception e) {
        System.out.println("onError"+e.getMessage());
    }
}
